/*
 * virtualdeviceexception.h
 *
 *  Created on: 18/01/2012
 *      Author: rbender
 */

#ifndef VIRTUALDEVICEEXCEPTION_H_
#define VIRTUALDEVICEEXCEPTION_H_

#include <exception>
#include <string>
#include <sstream>

namespace xvd
{
    class VirtualDeviceException: public std::exception
    {
        public:
            enum eExceptionType
            {
                None, SyntaxError
            };
            VirtualDeviceException(eExceptionType type, const std::string& message) :
                m_type(type), m_message(message)
            {
            }
            ~VirtualDeviceException() throw ()
            {

            }
            const char* what() const throw ()
            {
                std::stringstream str;
                str << m_type << ": " << m_message;
                return str.str().c_str();
            }
        private:
            eExceptionType m_type;
            std::string m_message;

    };
}

#endif /* VIRTUALDEVICEEXCEPTION_H_ */
